/*
 * @Descripttion: 核酸宝项目前端
 * @version: 
 * @Author: 杜宇轩
 * @Date: 2022-05-11 21:42:49
 * @LastEditors: 杜宇轩
 * @LastEditTime: 2022-05-22 06:23:45
 */
import Vue from 'vue';
const prefix = '/natms1/approval/notice/';

/**
 * 审批员查看自己的公告
 * request: {}
 */
 export const approverCheckNotice = () => {
  return Vue.$http({
    url: prefix + 'retrieve',
    method: 'get'
  });
};

/**
 * 审批员创建新的公告
 * request: {
 *  title: "", // 公告标题
 *  notice: "", // 公告内容
 *  onlyForVolunteer: true // 是否给志愿者发
 * }
 */
 export const approverAddNotice = (data) => {
  return Vue.$http({
    url: prefix + 'create',
    method: 'post',
    data: {
      title: data.title,
      notice: data.notice,
      onlyForVolunteer: data.onlyForVolunteer
    }
  });
};

/**
 * 审批员修改发布的公告
 * request: {
 *  id: "", // 公告id
 *  title: "", // 公告标题
 *  notice: "", // 公告内容
 *  onlyForVolunteer: true // 是否给志愿者发
 * }
 */
 export const approverUpdateNotice = (data) => {
  return Vue.$http({
    url: prefix + 'update',
    method: 'post',
    data: {
      id: data.id,
      title: data.title,
      notice: data.notice,
      onlyForVolunteer: data.onlyForVolunteer
    }
  });
};

/**
 * 审批员删除发布的公告
 * request: {
 *  id: "" // 公告id
 * }
 */
 export const approverDeleteNotice = (data) => {
  return Vue.$http({
    url: prefix + 'delete',
    method: 'post',
    data: {
      id: data.id
    }
  });
};
